package com.duolaibei.business.view.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;

import com.duolaibei.business.R;
import com.duolaibei.business.base.BaseDialog;
import com.duolaibei.business.utils.inject.Inject;

/**
 * Created by xlm on 2017/11/9 0009
 */

public class BluePrintNumDialog extends BaseDialog {

    @Inject(R.id.print_5)
    private TextView mTextView5;
    @Inject(R.id.print_4)
    private TextView mTextView4;
    @Inject(R.id.print_3)
    private TextView mTextView3;
    @Inject(R.id.print_2)
    private TextView mTextView2;
    @Inject(R.id.print_1)
    private TextView mTextView1;

    public BluePrintNumDialog(Context context) {
        super(context);
    }

    @Override
    protected void onSetContentView() {
        setContentView(R.layout.dialog_bluetooth_print_num);
    }

    @Override
    protected void initViews() {
        initWindow(1.0f, 0, Gravity.BOTTOM);
        setAnimate(R.style.animatedialog);
    }

    @Override
    protected void onSetListener() {
        mTextView5.setOnClickListener(this);
        mTextView4.setOnClickListener(this);
        mTextView3.setOnClickListener(this);
        mTextView2.setOnClickListener(this);
        mTextView1.setOnClickListener(this);
    }

    @Override
    protected void afterOnCreate(Bundle savedInstanceState) {

    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.print_5:
                listener.printNum("5");
                break;
            case R.id.print_4:
                listener.printNum("4");
                break;
            case R.id.print_3:
                listener.printNum("3");
                break;
            case R.id.print_2:
                listener.printNum("2");
                break;
            case R.id.print_1:
                listener.printNum("1");
                break;
        }
        dismiss();
    }

    private Listener listener;

    public void setListener(Listener listener) {
        this.listener = listener;
    }

    public static class Listener {
        public void printNum(String num) {

        }

        public void close() {

        }
    }
}
